<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>定位的特殊性</title>
    <style>
        span {
            position: absolute;
            /*绝对定位*/
            top: 300px;
            width: 200px;
            height: 150px;
            background-color: pink;
        }

        div {
            position: absolute;
            background-color: skyblue;
        }
    </style>
</head>

<body>
    <span>123</span>

    <div>abcd</div>

    <p>行内元素添加绝对或固定位置，可以直接设置高度和宽度。</p>
    <p>块级元素添加绝对或固定定位，如果不给宽度或高度，默认大小是内容的大小</p>
</body>

</html>